#ifndef _TRIMESH_NOISER_H_
#define _TRIMESH_NOISER_H_

#include <eigen/core>
#include <vector>
using namespace std;

//add Gaussian and impulisive noise to triangular mesh 
class TriMeshNoiser
{
public:
	TriMeshNoiser(){}
	~TriMeshNoiser(){}

public:
	void		addGaussianNoise(float noise_level, bool normal_direction, \
				const double & average_mesh_edge_length,\
				const vector<Eigen::Vector3d>& sourceMesh,\
				const vector<Eigen::Vector3d>& sourceMeshNormals,\
				vector<Eigen::Vector3d>& noisedMesh);

	void		addImpulsiveNoise(float noise_level, \
				float impulsive_level,\
				bool normal_direction, \
				const double & average_mesh_edge_length,\
				const vector<Eigen::Vector3d>& sourceMesh,\
				const vector<Eigen::Vector3d>& sourceMeshNormals,\
				vector<Eigen::Vector3d>& noisedMesh);

protected:
	Eigen::Vector3d    generateRandomDirection();
	void		randomDirections(int number, vector<Eigen::Vector3d> &RandomDirections);
	double		generateRandomGaussian(double mean, double StandardDerivation);  
	void		randomGaussianNumbers(double mean, double StandardDerivation, \
				int number, vector<double> &RandomNumbers);
	void		randomImpulsiveNumbers(int min, int max, int number,\
				double mean, double StandardDerivation,\
				std::vector< std::pair<int, double> > &VertexListAndRandomNumbers);
};

#endif
